@extends('backend::common.common_right')
@section('content')
    <div class="wrapper wrapper-content animated fadeInRight">

        <div class="row">
            <div class="col-sm-12">
                <div class="ibox-title">
                    <a  href="{{url('backend/articlecreate',['id'=>0,'type'=>3])}}" class="btn btn-primary ">添加案例</a>
                    <a  href="{{url('backend/articlecreate',['id'=>0,'type'=>1])}}" class="btn btn-primary ">添加APP案例</a>
                    <a  href="{{url('backend/articlecreate',['id'=>0,'type'=>2])}}" class="btn btn-primary ">采集论坛案例</a>
                </div>
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>案例ID</th>
                                <th>标题</th>
                                <th>收藏数</th>
                                <th>下载数</th>
                                <th>浏览数</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($articles as $ma)
                                <tr class="gradeX">
                                    <td>{{$ma->id}}</td>
                                    <td><a href="{{url('/modeInfoDefinition')}}?modeId={{$ma->id}}" target="__blank">{{$ma->title}}</td>
                                    <td class="center">{{$ma->collecnum}}</td>
                                    <td class="center">{{$ma->downnum}}</td>
                                    <td class="center">{{$ma->viewnum}}</td>
                                    <td class="center">
                                        <a href="{{url('backend/articlecreate',['id'=>$ma->id,'type'=>$ma->type])}}"><i class="fa fa-pencil"></i>编辑</a>&emsp;
                                        <a href="javascript:;" onclick="del({{$ma->id}})"><i class="fa fa-trash"></i>删除</a>
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        {{$articles->links()}}
                    </div>
                </div>
            </div>
        </div>
        <script>
            var del = function(id){
                layer.confirm('确定删除么(不可恢复)？', {
                    btn: ['确定','取消'] //按钮
                }, function(){
                    window.location.href = "{{url('backend/articledel')}}/"+id;
                }, function(){

                });
            }
        </script>

@endsection

